package com.youngjun.user.service;

import com.youngjun.common.mybatis.service.support.BaseService;
import com.youngjun.user.mapper.AddressMapper;
import com.youngjun.user.pojo.domain.Address;
import com.youngjun.user.pojo.dto.AddressDTO;
import com.youngjun.user.pojo.vo.AddressVO;

public interface AddressService extends BaseService<Address,AddressMapper> {

    /**
     * 创建地址
     * @param addressId 地址ID
     * @return AddressVO
     */
    AddressVO queryById(Long addressId);

    /**
     * 创建地址
     * @param dto 地址信息
     * @return AddressVO
     */
    AddressVO create(AddressDTO dto);

    /**
     * 校验地址是否相同
     * @param newAddress 地址信息
     * @param oldAddress 地址信息
     * @return boolean
     */
    boolean check(Address newAddress,Address oldAddress);

    /**
     * 转换地址
     * @param address 地址
     * @return AddressVO
     */
    AddressVO transform(Address address);
}